package scala.test_class.test_inner_class

/**
 * @author 黄海峰 2021/4/19 15:26
 * */
object DeanTest {
  def main(args: Array[String]): Unit = {
    val graph1: Graph = new Graph
    val node1: graph1.Node = graph1.newNode
    val node2: graph1.Node = graph1.newNode
    val node3: graph1.Node = graph1.newNode
    node1.connectTo(node2)
    node3.connectTo(node1)

//    val graph1: Graph = new Graph
//    val node1: graph1.Node = graph1.newNode
//    val node2: graph1.Node = graph1.newNode
//    node1.connectTo(node2)      // legal
//    val graph2: Graph = new Graph
//    val node3: graph2.Node = graph2.newNode
//    node1.connectTo(node3)      // illegal!
  }
}
